<?php

namespace App\State;


//环境上下文
class Context extends AbstractState
{
    //当前的状态 state, 根据我们的业务流程处理，不停的变化
    private $state;

    public function checkEvent(Context $context) {
        $this->state->checkEvent($context);
        $this->getCurrentState();
    }

    
    public function  checkFailEvent(Context $context) {
        $this->state->checkFailEvent($context);
        $this->getCurrentState();
    }


    public function  makePriceEvent(Context $context) {
        $this->state->makePriceEvent($context);
        $this->getCurrentState();
    }


    public function  acceptOrderEvent(Context $context) {

        $this->state->acceptOrderEvent($context);
        $this->getCurrentState();
    }


    public function  notPeopleAcceptEvent(Context $context) {
        $this->state->notPeopleAcceptEvent($context);
        $this->getCurrentState();
    }


    public function  payOrderEvent(Context $context) {
        $this->state->payOrderEvent($context);
        $this->getCurrentState();
    }


    public function  orderFailureEvent(Context $context) {
        $this->state->orderFailureEvent($context);
        $this->getCurrentState();
    }


    public function  feedBackEvent(Context $context) {
        $this->state->feedBackEvent($context);
        $this->getCurrentState();
    }

    public function  getState() {
        return $this->state;
    }

    public function  setState(State $state) {
        $this->state = $state;
    }

    public function getCurrentState()
    {

        echo "当前状态 : ". $this->state->getCurrentState();

        return $this->state->getCurrentState(); // TODO: Change the autogenerated stub
    }
//    public function getCurrentState() {
//        echo "当前状态 : " .getCurrentState();
//        return $this->getCurrentState();
//    }

}
